const koa = require("koa");
const app = new koa();
const cors = require('koa-cors');
const router = require('koa-router')();
const mainRouter = require('./routers/index');
const detailRouter = require('./routers/detail');
const transferRouter = require('./routers/transfer')
const cityRouter = require('./routers/city')
// 挂载跨域中间件
app.use(cors());
app.use(mainRouter);
router.use('/detail', detailRouter);
router.use('/transfer', transferRouter)
router.use('/city', cityRouter)
app.use(router.routes())

app.listen(3011, () => {
    console.log("Your app is running");
})